from threading import Thread
import time


def sleeper(i):
    print(f"thread {i} sleep for 5 seconds")
    time.sleep(5)
    print(f"thread {i} wake up")


if __name__ == "__main__":
    thread_array = []
    for i in range(5):
        t = Thread(target=sleeper, args=(i,))
        t.start()
        thread_array.append(t)
    for t in thread_array:
        t.join()